home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Very Best of Atari Inside
/
The Very Best of Atari Inside 1.iso
/
mint
/
mntlib43
/
mntlib
/
strspn.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-17
|
520b
|
29 lines
/* from Henry Spencer's stringlib */
#include <string.h>
/*
* strspn - find length of initial segment of s consisting entirely
* of characters from accept
*/
size_t
strspn(s, accept)
const char *s;
const char *accept;
{
register const char *sscan;
register const char *ascan;
register size_t count;
count = 0;
for (sscan = s; *sscan != '\0'; sscan++) {
for (ascan = accept; *ascan != '\0'; ascan++)
if (*sscan == *ascan)
break;
if (*ascan == '\0')
return(count);
count++;
}
return(count);
}